package com.fast.model.result.common;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @author hujunwei
 */
@ApiModel(value = "PageResult<T>", description = "分页结果返回实体类")
@Data
public class PageResult<T> implements Serializable {
    @ApiModelProperty(name = "code", value = "状态码", example = "")
    private Integer code;

    @ApiModelProperty(name = "msg", value = "状态信息", example = "" + Msg.SELECT_OK)
    private String msg;

    @ApiModelProperty(name = "total", value = "总条数", example = "100")
    private Long total;

    @ApiModelProperty(name = "data", value = "当前页结果")
    private List<T> data;

    public PageResult() {
    }

    public PageResult(int code, String msg, Long total, List<T> data) {
        this.code = code;
        this.msg = msg;
        this.total = total;
        this.data = data;
    }
}
